package com.mach.platform.domain;

import com.mach.platform.domain.iot.IotDev;
import com.mach.platform.domain.iot.IotSpace;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;

/**
 * @author Administrator
 * @Description:   图片定位 点的信息记录
 * @Package: com.mach.platform.domain
 * @time 2018/7/31 0031 10:49
 */
@Entity
@Table(name = "localtion")
@Data
public class Localtion implements Serializable {
	private static final long serialVersionUID = -8485346830864732545L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;

	@Column(name = "space_id")
	private Long spaceId;

	@OneToOne
	@JoinColumn(name = "device")
	private IotDev device;

	@OneToOne
	@JoinColumn(name = "space")
	private IotSpace space;

	@Column(name = "p_left",length = 100)
	private String left;
	@Column(name = "p_top",length = 100)
	private String top;

	/**
	 *    0 为空间定位
	 *    1 为 设备定位
	 */
	@Column(name = "type", columnDefinition = "tinyint default 1 COMMENT '0 为空间定位 1 为 设备定位'")
	private Integer type;

}
